OpenSCAD Cookbook: OpenSCAD Recipes for learning 3D modeling by John Craig

OpenSCAD Cookbook: OpenSCAD Recipes for learning 3D modeling by John Craig

Author:John Craig [Craig, John]
Language: eng
Format: epub
Publisher: Books To Believe In
Published: 2018-12-31T22:00:00+00:00


Okay, you now have your cake, but you can't eat it too. Let's discuss a few of the baking secrets.

The numerical parameters controlling sizes, shapes, and translations of everything are all isolated in a block of code for easy review and maintenance. The first little experimentation challenge is to put the "Happy Birthday!" text up there too, assigned to a variable that is in turn used in the text() action command.

Notice the strange looking characters within the text string. This string ("\u263A")is the Unicode designation for one character, a happy face, which shows up on the cake. There are many other characters available, depending on the choice of font.

Start at the official Cheat Sheet, click on the text() command, and scroll down to learn all about available fonts, Unicode characters, and related information. For this cake, I chose "Liberation Sans" as the font, but there are many others available. The documentation examples show how to add bold, italics, and other modifications to your text.

To make sure the white text intersects with the red cake, the translation of the text in the z direction is slightly less than the height of the cake. Look in the text_translate variable for the z component, poly_height-.1. By default, OpenSCAD combines shapes that intersect each other in this way into a single shape, using the union operator. The next recipe will demonstrate a couple other boolean operators used to combine 3D shapes in powerful ways.

Be sure to play with the various parameters to experiment with this cake. One challenge would be to split "Happy", "Birthday!", and the happy face character onto three lines, to use the surface of the cake more effectively.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.